package siac.com.dao;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;

import siac.com.configuracao.ConexaoHibernate;
import siac.com.entity.AppModulo;
import siac.com.entity.AuthPerfil;


public class AuthPerfilDao extends AbstractHibernateDao<AuthPerfil> {
	public AuthPerfilDao() {
		super(AuthPerfil.class);
	}

	@Override
	protected Session getSession() {
		return ConexaoHibernate.getSessionFactory().getCurrentSession();
	}

	public List<AuthPerfil> findCode(Object code) {
		Query query = this.getSession().getNamedQuery("AuthPerfil.findByCode");
		query.setParameter("code", code);
		return query.list();
	}

	public List<AuthPerfil> findName(Object name) {
		Query query = this.getSession().getNamedQuery("AuthPerfil.findByName");
		query.setParameter("name", name);
		return query.list();
	}

	public List<AuthPerfil> findStatus(Object status) {
		Query query = this.getSession()
				.getNamedQuery("AuthPerfil.findByStatus");
		query.setParameter("status", status);
		return query.list();
	}
}
